// 重写el-message
import { Message } from 'element-ui';
const $message = options => {
  return Message({
    ...options,
    offset: 70
  });
};
['success', 'warning', 'info', 'error'].forEach(type => {
  $message[type] = options => {
    if (typeof options === 'string') {
      options = {
        message: options,
        offset: 70
      };
    }
    options.type = type;
    return Message(options);
  };
});
Vue.prototype.$message = $message;
//不加这行代码运行this.$message.closeAll时会报错
Vue.prototype.$message.closeAll = Message.closeAll;